<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2018 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2018/8/25
 * Time: 下午8:55
 */

namespace App\Library;


use Illuminate\Auth\TokenGuard;

class ApiTokenGuard extends TokenGuard
{

    public function getTokenForRequest()
    {
        $token = $this->request->header('x-access-token');
        if (empty($token)) {
            $token = parent::getTokenForRequest();
        }
        return $token;
    }
}
